// Copyright 2007 Google, Inc. All Rights Reserved.

package com.google.jessewilson.codesearch.util;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @author jessewilson
 */
public class Throwables {

  public static String stackTraceToString(Throwable t) {
    StringWriter stringWriter = new StringWriter();
    PrintWriter printWriter = new PrintWriter(stringWriter);
    t.printStackTrace(printWriter);
    return stringWriter.toString();
  }
}
